home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Atari Compendium
/
The Atari Compendium (Toad Computers) (1994).iso
/
files
/
umich
/
music
/
miditalk.arc
/
MIDITALK.DOC
< prev
next >
Wrap
Text File
|
1985-11-20
|
12KB
|
314 lines
MIDITALK
Copyright 1987 Rich Hickey
May be distributed freely but NOT sold, provided this
copyright notice remains intact. All other rights reserved.
Miditalk is an interactive utility that let's you 'converse'
with your MIDI equipment from your Atari ST. If you're just getting
into MIDI it is a great way to see what's really travelling over the
MIDI lines. If you are a programmer working in a compiled language
like C or Pascal, you know how frustrating it can be to re-compile
and link every time you try to get a new MIDI message to work.
Miditalk displays all incoming MIDI data on screen. It also
enables you to type in data and have it sent over the MIDI port.
Miditalk also let's you create your own MIDI-macros and save and
load data dumps.
MIDI Basics
What actually goes on over MIDI ? Well, the first concept
to grasp is that no 'sound' travels via MIDI. As with most computer
interfaces, numeric data is the stuff of MIDI. Musical instrument
manufacturers got together and decided on a set of codes and a
protocol for their transmission. The keeper of the code is the
IMA (International MIDI Association), and for $35 they will send
you the detailed MIDI Specification. If you plan on doing any
serious MIDI work I recommend it. If you're just tinkering, or
you can't wait for the spec to arrive - have no fear. Miditalk
does most of the work for you.
(Note: All values in this program and article will be notated
in hexadecimal unless otherwise indicated. If you are unfamiliar
with hex consult any introductory level computer text for an
explanation.)
Let's look at a typical MIDI message. If you press and
release middle C on your keyboard it will transmit something like
this:
90 3c 40 80 3c 00
How do we decipher this ? The MIDI spec tells us that all
bytes in the range of 80 to ff (all of which have their leftmost
bit set to 1) are 'Status' bytes. Status bytes can tell us anything
from 'A note was turned on' to 'The mod wheel was moved'. These
status bytes are usually followed by one or more 'Data' bytes, which
tell us what note was played and how hard, or how far the mod wheel
was spun. Data bytes range from 00 to 7f. (Never greater).
In the message above, 90 and 80 are status bytes. 90 is the
code for 'Note On', 80 for 'Note Off'. Both commands are followed
by two data bytes; the note number and the velocity (how hard the
note was struck). When you try this with Miditalk you'll see something
like this:
NON01 3c 40 NOF01 3c 00
You might get this:
NON01 3c 40 NON01 3c 00
But you only turned one note on ?! Some synths turn off a note
with a 'Note On' command with a velocity value of 00. The beauty of
Miditalk is being able to see how different synths implement the
'standard'. Miditalk checks for incoming status bytes, translates
them into an abbreviation and displays them in reverse text. Some
status bytes (like 'Note On') have the MIDI channel number on which
they were sent incorporated in them. MIDI has 16 channels so that
many synths can communicate over the same line. Each synth responds
only to messages sent on it's channel. The channel #, in decimal,
will be displayed in reverse following the abbreviation as in the
above case. NON01 represents one byte, not two. All data bytes
are displayed in normal text. Remember, all values are hex.
Using Miditalk
When you first boot up Miditalk (medium or high rez recommended)
you will be prompted for the capture buffer size. This buffer will
be used to capture data dumps etc. 10K should be large enough for
most synth dumps.
Next you will be asked to specify a library to load. DEFAULT.LIB
contains macros for all of the status bytes. If you hit return
without an entry the load will be cancelled and you will start with
Miditalk's small, built-in library.
Finally, you will be asked if you want to 'channelize' your data.
If your synth is set to a MIDI channel other than one, you will want
to send data on that channel. Indicate yes and specify a channel.
If you choose not to channelize, your data will be sent on channel 1.
O.K. - play some notes, move the pitch bend, change patches
and watch the show !
The program is Miditalk, not Midilisten, and the ability to
transmit is what it's all about. To go into the Talk/Command mode
just hit the spacebar. You can now type in your command/message.
The parser expects the following format:
Status and data bytes are two digit hex values using lower
case letters. (b0 21 7a etc.)
Each byte is separated by a space.
Macros are all Upper case letters. Macros are separated from
one other by a space.
Macros and hex values can be combined on a Talk line. for
example, to turn on middle C:
Go into Talk/Command mode (space bar)
Type NON 3c 50 Hit return.
NOF 3c 00 will turn it off. After each command/message you are
returned to the monitor mode to see what response, if any , there
was from the synth. Note that NON and NOF are not followed by
the MIDI channel. This is automatically handled by the channelization
feature. You are probably wondering what macros are available
and what they represent. Go into the Talk/Command mode and type:
SHOWLIB (return)
This will display the contents of the currently loaded library.
SHOWLIB is a command. Commands are built into the program,
not the library. They are always available. Like macros, they are
all caps and must be separated by a space. Most do not cause anything
to be sent over the MIDI line. The available commands are:
CHAN - to change MIDI channels or channelization status.
SHOWLIB - displays library.
SAVELIB - saves library to disk
LOADLIB - loads library from disk
SENSING - toggles active sensing filter
BUFON - turns on capture buffer
BUFOF - turns off capture buffer
BUFRST - resets capture buffer for new data
SAVEBUF - saves capture buffer to disk
LOADBUF - loads capture buffer from disk
TRANSMIT sends capture buffer data over MIDI port
RPT - repeats previous Talk/Command line
CLR - clears MIDI input backlog
MACRO - create or redefine a macro
Note that commands are executed as they are encountered by
the parser while outgoing data is not sent until the entire line
is parsed. Therefore they will be executed before any data is
sent, even if they are in the middle of the line.
Macros
As you can see from looking at the library, macros can stand
for one byte or a whole string. Macros can also contain other
macros. By 'nesting' macros you can create very powerful, easy to
use tools. To create a macro use the MACRO command. You'll be
prompted for a name. If you enter a name that already exists you
will have an opportunity to redefine it. Next, simply enter the
macro in the same format as any Talk line. Voila! Your macro is
now in the library (try SHOWLIB). Remember to save the library if
you've added something worthwhile to it. You can create custom
libraries for each synth if you like. Each library can contain up
to 100 macros. Theoretically, macros may contain commands, but
any commands will be carried out while you are defining the macro.
This is due to the macro validation process. If you can deal with
this, fine, otherwise keep commands out of macros.
The Capture Buffer
At some point in your experimentation you will probably meet
up with 'System Exclusive'. Most synths and drum machines have
some way of 'dumping' their patch data or sequencer data via MIDI.
Unfortunately, there is no standard way to do this.The MIDI spec
provides the System Exclusive status byte, after which each
manufacturer can utilize their own system for dumps o